home *** CD-ROM | disk | FTP | other *** search
/ NetNews Offline 2 / NetNews Offline Volume 2.iso / news / comp / lang / c++-part1 / 6207 < prev    next >
Encoding:
Internet Message Format  |  1996-08-05  |  769 b 

  1. Path: Milpitas01.pop.internex.net!art90
  2. From: Artyom@kansmen.com (Art Shelest)
  3. Newsgroups: comp.lang.c++
  4. Subject: Re: newing char**
  5. Date: Sun, 11 Feb 96 00:43:00 GMT
  6. Organization: Kansmen Corp.
  7. Message-ID: <4fje7o$dl2@Milpitas01.Pop.Internex.NET>
  8. References: <4fggal$4pf@darkstar.UCSC.EDU>
  9. NNTP-Posting-Host: 205.158.201.203
  10. X-Newsreader: News Xpress Version 1.0 Beta #3
  11.  
  12. In article <4fggal$4pf@darkstar.UCSC.EDU>,
  13.    jono@cse.ucsc.edu (Jonathan Gibbs) wrote:
  14. >If I have the following declaration:
  15. >
  16. >char **name;
  17. >
  18. >The following line compiles fine with g++, but I get the following 
  19. >error on SGI's CC. Which is right?
  20. >
  21. >int num; 
  22. >name = new (char*)[num];
  23. >for (int i=0; i < num; i++) {
  24. >   name = new char[25];
  25. >}  ^^^^^^^
  26.  
  27. Maybe you meant name[i] = ...
  28.  
  29.    _Art.
  30.